package com.springbootblog.controller.fontend;

import com.springbootblog.service.fontend.MessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * 关于我们页面接口
 * @className AboutController
 * @author camellia
 * @email 805795955@qq.com
 * @date 2024/01/01
 * @version 1.0
 */
@RequestMapping("java")
@RestController
//@CrossOrigin(origins="*",maxAge=3600)
public class AboutController
{
    /**
     * 自动装载（service接口注入）
     */
    @Autowired
    private MessageService messageService;

    /**
     * 获取评论列表
     * @return
     */
    @GetMapping("about/getMessgetList")
    public Map<String,Object> getMessageList()
    {
        Map<String,Object> result = messageService.getMessageList();
        return result;
    }

    /**
     * 提交留言
     * @return
     */
    @GetMapping("about/putmessage")
    public Map<String,Object> putmessage(@RequestParam(defaultValue = "") String email, @RequestParam(defaultValue = "") String content_reply, @RequestParam(defaultValue = "") String replyid, HttpServletRequest request)
    {
        Map<String,Object> result = messageService.putmessage(email, content_reply, replyid, request);
        return result;
    }


}
